package com.example.administrator.ksf_zty.SauceActivity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import com.example.administrator.ksf_zty.Activity.MainActivity;
import com.example.administrator.ksf_zty.ProduceActivity.ProduceBasketScanActivity;
import com.example.administrator.ksf_zty.ProduceActivity.ProduceMenuActivity;
import com.example.administrator.ksf_zty.R;
import com.example.administrator.ksf_zty.util.BaseActivity;
import com.example.administrator.ksf_zty.util.TitleUtils;

public class SauceMenuActivity extends BaseActivity {

    ImageButton back;
    Button titleButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sauce_menu);
        SetTitle();
        SetOnClick();
    }

    //按钮
    private void SetOnClick() {
        //粉、酱、菜包入库
        Button btnIn = (Button) findViewById(R.id.SauceMenu_btnIn);
        btnIn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Intent intent = new Intent(SauceMenuActivity.this, MainActivity.class);
//                intent.putExtra("name", "");//传参数
//                startActivity(intent);
            }
        });
        //营养剂室投料扫描
        Button btnScan = (Button) findViewById(R.id.SauceMenu_btnScan);
        btnScan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Intent intent = new Intent(SauceMenuActivity.this, MainActivity.class);
//                intent.putExtra("name", "");//传参数
//                startActivity(intent);
            }
        });
        //返回按钮
        Button btnCancel = (Button) findViewById(R.id.SauceMenu_btnCancel);
        btnCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SauceMenuActivity.this, MainActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
    }

    private void SetTitle() {
        back = (ImageButton) findViewById(R.id.back);
        titleButton = (Button) findViewById(R.id.titleButton);
        //设置标题(第三个参数是标题文字，直接替换""内容即可，第五个参数是标题右边按钮文字，第六个参数是设置是否显示返回按钮)
        TitleUtils.setTitle(this, R.id.title_sys_set, "酱包前处理菜单页面", this,
                "", true);
        //返回按钮事件
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
